<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        /**
         * 操作用户表
         */
        Schema::create('users', function (Blueprint $table) {
            $table->integer('id', true);
            $table->string('name', 191)->comment('姓名');
            $table->string('username', 191)->unique('username_UNIQUE')->comment('用户名');
            $table->string('type', 100)->nullable()->comment('身份');
            $table->string('password', 191);
            $table->string('sex')->nullable()->comment('性别');
            $table->string('school_id', 191)->comment('所属学校');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
